package com.david.learning.algorithm;

/**
 * Calculate how many possibilities if there are 3 possible step for a certain high ladder.
 * @author David Qi
 *
 */
public class LadderQuestion {
	private static final int[] STEP  = {2,3,4};
	
	public static void main(String[] args){
		System.out.println(claim(6));
	}
	
	public static int claim(int totalSteps){
		int sum = 0;
		if(totalSteps == 0){
			return 1;
		}else if(totalSteps < 0){
			return 0;
		}else{
			for (int step : STEP) {
				sum += claim(totalSteps - step);
			}
		}
		return sum;
	}
}
